﻿
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace MachineVision.Domain
{
    public class TemperatureInfo : IEntity
    {

        [Column(TypeName = "decimal(6,2)")]
        public decimal TemperatureC { get; set; }
        //湿度
        [Column(TypeName = "decimal(6,2)")]
        public decimal Humidity { get; set; }
        //[NotMapped]
        //public double TemperatureF => Math.Round(32 + ((double)TemperatureC / 0.556), 2);
        [MaxLength(200)]
        public string? Description { get; set; }
        //[NotMapped, DatabaseGenerated(DatabaseGeneratedOption.Computed)]
        //public DateOnly Date => DateOnly.FromDateTime(TempTime);

        //[NotMapped, DatabaseGenerated(DatabaseGeneratedOption.Computed)]
        //public TimeOnly Time => TimeOnly.FromDateTime(TempTime);
        [Required]
        public DateTime TempTime { get; set; }
        public int? WorkPlace { get; set; }
    }
}
